package com.infolab.aims.domain;

import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang.builder.ToStringBuilder;
import com.infolab.aims.common.SpecialToStringStyle;
import com.infolab.aims.common.bean.AbstractModelBean;


/**
 * collect UI input value
 * 
 * @author hubo
 * @see locationSystemCodeForm.jsp
 * 
 */
public class LocationBean extends AbstractModelBean implements Serializable {
	private String[] repairTransferLocation;

	private String workOrderActiveLocation;

	private String componentIssueMainLocation;

	private String workOrderFaultLocation;

	private String workOrderInVehicleLocation;

	private List<Location> locations;

	public String[] getRepairTransferLocation() {
		return repairTransferLocation;
	}

	public void setRepairTransferLocation(String[] repairTransferLocation) {
		this.repairTransferLocation = repairTransferLocation;
	}

	public String getWorkOrderActiveLocation() {
		return workOrderActiveLocation;
	}

	public void setWorkOrderActiveLocation(String workOrderActiveLocation) {
		this.workOrderActiveLocation = workOrderActiveLocation;
	}
	

	public String getWorkOrderFaultLocation() {
		return workOrderFaultLocation;
	}

	public void setWorkOrderFaultLocation(String workOrderFaultLocation) {
		this.workOrderFaultLocation = workOrderFaultLocation;
	}

	public String getWorkOrderInVehicleLocation() {
		return workOrderInVehicleLocation;
	}

	public void setWorkOrderInVehicleLocation(String workOrderInVehicleLocation) {
		this.workOrderInVehicleLocation = workOrderInVehicleLocation;
	}

	public List<Location> getLocations() {
		return locations;
	}

	public void setLocations(List<Location> locations) {
		this.locations = locations;
	}

	public String getComponentIssueMainLocation() {
		return componentIssueMainLocation;
	}

	public void setComponentIssueMainLocation(String componentIssueMainLocation) {
		this.componentIssueMainLocation = componentIssueMainLocation;
	}
	
	public String getAuditContentHead()
	{
		String[] str = repairTransferLocation;
		String repairTransferLocationValue="";
		if(str!=null){
			for(int i=0;i<str.length;i++)
				if(i==0)
				repairTransferLocationValue = repairTransferLocationValue + str[i];
				else 
					repairTransferLocationValue = repairTransferLocationValue+ " ,"+str[i];
		}
		
		return new ToStringBuilder(this,SpecialToStringStyle.SPECIAL_STYLE)
			.append("Repair Transfer Loc",repairTransferLocationValue)
			.append("WO Active Loc",workOrderActiveLocation)
			.append("WO Fault Loc", workOrderFaultLocation)
			.append("WO InVehicle Loc",workOrderInVehicleLocation)
			.append("Component Issue Main Loc",componentIssueMainLocation)
			.toString();
	}
	
	public String getAuditContentDetail()
	{		
		return super.getAuditContentDetail();
	}

	
	public String getAuditCode()
	{
		return "Location Configuration";
	}

	
}
